package com.it.tydic.estate.module.controller.khgl;

import com.it.tydic.estate.common.annotation.ControllerDesc;
import com.it.tydic.estate.common.aop.Result;
import com.it.tydic.estate.common.constants.LogConstants;
import com.it.tydic.estate.module.model.inner.TbMoveIn;
import com.it.tydic.estate.module.model.inner.TbMoveOut;
import com.it.tydic.estate.module.service.MoveOutService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @description:
 * @author: liuhui
 * @createDate: 2020/3/4
 * @version: 1.0
 */
@RestController
@RequestMapping("moveOut")
@Api(tags = "迁出管理")
public class MoveOutController {
    @Autowired
    private MoveOutService moveOutService;   /*迁出*/

    /**
     * 查询获取所有可以迁出的房间
     * @param map
     * @return
     */
    @PostMapping("/selectListByLike")
    @ApiOperation(value = "查询获取所有可以迁出的房间", notes = "查询获取所有可以迁出的信息列表")
    public Result selectListByLike (@RequestBody Map<String,Object> map){
        return moveOutService.selectListByLike(map);
    }

    /**
     * 迁出的房间详情
     * @return
     */
    @GetMapping("/getById/{uid}")
    @ApiOperation(value = "迁出的房间详情", notes = "迁出的房间详情")
    public Result getById(@RequestParam String uid){
        return moveOutService.getById(uid);
    }

    /**
     * 迁出数据添加
     * @param tbMoveOut
     * @return
     */
    @PostMapping("/addMoveOut")
    @ControllerDesc(description = LogConstants.addOrUpdate_data)
    @ApiOperation(value = "迁出数据添加", notes = "迁出数据添加")
    public Result addMoveOut(@RequestBody TbMoveOut tbMoveOut){
        return moveOutService.addMoveOut(tbMoveOut);
    }
}
